<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" xmlns:form="http://www.w3.org/1999/html"
      layout:decorator="admin/public/layout">

<head>
    <title>新建用户组</title>
</head>
<div  layout:fragment="content">
    <section class="content-header">
        <h1>
            新建用户组
            <small>添加新用户组</small>
        </h1>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box box-primary">
                    <form th:object="${role}" role="form" name="addForm" method="POST" th:action="@{/admin/role/create}">
                        <input type="hidden" name="_token" value="{{ csrf_token() }}">
                        <div class="box-body">
                            <div th:class="${#fields.hasErrors('name')}?'form-group has-error':'form-group'">
                                <label>用户组名称</label>
                                <input  autofocus="autofocus" type="text" name="name" class="form-control " placeholder="请输入新用户组名称" th:value="${role.name}">
                                <p th:if="${#fields.hasErrors('name')}" class="help-block" th:text="${#fields.errors('name')[0]}"></p>
                            </div>
                        </div>
                        <div class="box-footer">
                            <button type="submit" class="btn btn-primary">保存</button>
                            <button type="reset" class="btn btn-success">重置</button>
                        </div>
                    </form>

                </div>
            </div>
        </div>
    </section>
    <script>
        $("input").focus();
    </script>
</div>
